<?php
use yii\helpers\Html;
use yii\helpers\Url;
use yii\bootstrap\ActiveForm;
use yii\widgets\LinkPager;
use backend\models\Category;
?>
<style type="text/css">
	.lists img{
		margin: 10px;
	}
	.lists h4,h3,h2{
		font-weight: bold;
	}
	.lists p{
		text-indent: 2em;
		color: white !important;
		font-weight: bold;
	}

	.lists a{
		background-color: #B1A4A4 !important;
		border-color: white !important;
	}
</style>
<table class="table table-striped">
    <thead>
    <tr>
        <th>序号</th>
        <th>标题</th>
        <th>导航</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <?php foreach (Category::getLvLists(Category::getData(), 0, 0) as $key => $value) {?>
        <tr>
            <th scope="row"><?=$value['id']?></th>
            <td><?=$value['name']?></td>
            <td>
                <?php
                if($value['is_show'] == 0){?>
                    <span style="color: red;">不显示</span>
                <?php }elseif($value['is_show'] == 1){ ?>
                    <span style="color: green">显示</span>
                <?php }?>
            </td>
            <td>
                <?php
                if($value['status'] == 0){?>
                    <span style="color: red;">禁用</span>
                <?php }elseif($value['status'] == 10){ ?>
                    <span style="color: green">启用</span>
                <?php }?>
            </td>
            <td>
                <a href="<?=Url::to(['category/create', 'id' => $value['id']])?>" class="btn btn-warning">修改</a>
                <a href="<?=Url::to(['category/del', 'id' => $value['id']])?>" class="btn btn-danger">删除</a>
            </td>
        </tr>
    <?php }?>
    </tbody>
</table>
